<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: owen
  Date: 2017/4/21
  Time: 16:27
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<c:set var="BASE" value="${pageContext.request.contextPath}"/>
<jsp:include page="side.jsp"/>
<jsp:include page="easyui.jsp"/>
<html>
<head>
    <title>sale</title>
</head>
<body>
<h3 align="center">销售开单</h3>
<p>

<div style="margin:20px 0;">
    <a href="${BASE}/sale" class="easyui-linkbutton" >New Sale</a>
</div>

</p>
<form action="/enter_item" method="post">
    <table  width="70%">
            商品编号<input  type="text" name="code" /></td>
            数   量<input class="easyui-numberbox" value="1" type="text" name="quantities" /></td>
            <input  type="submit" value="确  定"/>
    </table>
</form>
<div style="margin:20px 0;">
    <a href="/end_sale" class="easyui-linkbutton" >End Sale</a>
</div>
<div style="margin:20px 0;">
<label>   总金额</label>
    <textarea class="easyui-textbox">${total}</textarea>
</div>



<form action="/pay" method="post">
    <table border="1" width="70%">

        实   收<input class="easyui-numberbox" value="${recieve}" type="text" name="amount"  />

         <input type="submit" value="确认支付">
<p>
        <label>找  零</label>
       <textarea class="easyui-textbox">${balance}</textarea>
    </table>

</form>
<table id="tt" class="easyui-datagrid" style="text-align: center" width="85%" >
    <thead>
    <tr>
        <th field="name1" width="100">编号</th>
        <th field="name2" width="200">名称</th>
        <th field="name3" width="100">数量</th>
        <th field="name4" width="100">价格</th>
    </tr>

    </thead>
    <tbody>

    <c:forEach  var="product" items="${tableModelList}">
        <tr>
            <td>${product.id}</td>
            <td>${product.desc}</td>
            <td>${product.quantity}</td>
            <td>${product.price}</td>

        </tr>
    </c:forEach>
    </tbody>
</table>
</table>
<c:if test="${flag}">
    <script>
            $.messager.alert('支付提醒','支付金额不足');
    </script>
</c:if>

</body>
</html>
